package com.topfinance.cmt;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class SystemUtil {

	public static String getFileData(String fileAbsolutePath) {
		FileInputStream in = null;
		String fileData = "";
		// set file data
		File file = new File(fileAbsolutePath);
		int length = (int) file.length();
		byte[] buf = new byte[length]; // 1M buffer
		int bytesRead = 0;
		try {
			in = new FileInputStream(file);
			bytesRead = in.read(buf);
			fileData = new String(buf, "gbk");

		} catch (Exception e) {
			return null;
		} finally {
			try {
				in.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return fileData;
	}
}
